<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %>
<%@ taglib prefix="custom" tagdir="/WEB-INF/tags" %>
<html>
<body>
<form:form commandName="formDto" id="form" cssClass="form-horizontal form-bordered">
    <form:hidden path="caseUuid"/>
    <form:hidden path="allow" id="allow"/>
    <div class="modal-header">
        <button type="button" class="close"
                data-dismiss="modal" aria-hidden="true">
            &times;
        </button>
        <h4 class="modal-title" id="myModalLabel">
            案件审核
        </h4>
    </div>
    <div class="modal-body">
        <div class="form-group">
            <div class="col-sm-12"><h4 class="panel-title">举报人信息</h4></div>
        </div>
        <div class="form-group row">
            <label class="col-sm-1 control-label">头像:</label>

            <div class="col-sm-2">
                <p class="form-control-static">
                    <img src="${formDto.caseDto.creatorDto.headimgurl}" alt="头像" class="img-rounded"
                         style="width: 30px;height: 30px;"/>
                </p>
            </div>
            <label class="col-sm-1 control-label">昵称:</label>

            <div class="col-sm-2">
                <p class="form-control-static">
                                <span class="label label-primary">     ${formDto.caseDto.creatorDto.nickname}
                                <c:if test="${not empty formDto.caseDto.creatorDto.sex}"> (
                                    <c:if test="${formDto.caseDto.creatorDto.sex =='1'}">男</c:if>
                                    <c:if test="${formDto.caseDto.creatorDto.sex =='2'}">女</c:if>
                                    <c:if test="${formDto.caseDto.creatorDto.sex =='0'}">未知</c:if>
                                    )</c:if>
                                </span>
                </p>
            </div>
            <label class="col-sm-1 control-label">地址:</label>

            <div class="col-sm-2">
                <p class="form-control-static">
                        ${formDto.caseDto.creatorDto.country}${formDto.caseDto.creatorDto.province}${formDto.caseDto.creatorDto.city}
                </p>
            </div>
            <label class="col-sm-1 control-label">电话:</label>

            <div class="col-sm-2">
                <p class="form-control-static">
                        ${formDto.caseDto.phone}
                </p>
            </div>
        </div>
            <%--<div class="form-group">--%>
            <%--<div class="col-sm-12"><h4 class="panel-title">案件档案</h4></div>--%>
            <%--</div>--%>
            <%--<div class="form-group">--%>
            <%--<div class="col-sm-12">--%>
            <%--<iframe src="records.htm?mini=true&uuid=${formDto.caseUuid}" style="border:none;width:100%;height:300px;"></iframe>--%>
            <%--</div>--%>
            <%--</div>--%>
        <div class="form-group">
            <div class="col-sm-12"><h4 class="panel-title">举报图片</h4></div>
        </div>
        <div class="form-group">
            <div class="col-sm-12">
                <iframe src="images.htm?mini=true&uuid=${formDto.caseUuid}"
                        style="border:none;width:100%;height:300px;"></iframe>
            </div>
        </div>
        <div class="form-group">
            <div class="col-sm-12"><h4 class="panel-title">完成图片</h4></div>
        </div>
        <div class="form-group">
            <div class="col-sm-12">
                <iframe src="images.htm?mini=true&uuid=${formDto.caseUuid}&result=true"
                        style="border:none;width:100%;height:300px;"></iframe>
            </div>
        </div>
        <div class="form-group">
            <div class="col-sm-12">
                <textarea name="content" id="content" class="form-control" rows="5" placeholder="请填写驳回原因(如果不需要驳回则不填写)"
                          required="required"></textarea><br/>
                <span class="error text-danger ErrorText"></span>
            </div>
        </div>
    </div>
    <div class="modal-footer">
        <button type="button" class="btn btn-primary SubmitBtn" allow="true">
            确定
        </button>
        <button type="button" class="btn btn-danger SubmitBtn" allow="false">
            驳回
        </button>
        <button type="button" class="btn btn-default" data-dismiss="modal">关闭
        </button>
    </div>
</form:form>
<script type="text/javascript">
    $(".SubmitBtn").click(function () {
        $("#allow").val($(this).attr("allow"));
        var serialize = $("#form").serialize();
        $.ajax({
            url: 'pending',
            data: serialize,
            type: 'post',
            cache: false,
            success: function (data) {
                if (data.state) {
                    window.location.reload();
                } else {
                    $(".ErrorText").html(data.msg);
                }
            },
            error: function () {
                alert("失败");
            }
        });
    });
</script>
</body>
</html>
